package com.nopay.cdxphone.dialog;

import android.app.Activity;
import android.app.Dialog;
import android.os.Bundle;
import androidx.annotation.NonNull;
import com.nopay.cdxphone.R;

public class DialogPleaseOpenMember extends Dialog {

    public DialogPleaseOpenMember(@NonNull Activity context) {
        super(context, R.style.MyDialog);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dialog_please_open_member);

        findViewById(R.id.tv_dialog_cancel).setOnClickListener(v -> dismiss());
        findViewById(R.id.tv_dialog_confirm).setOnClickListener(v -> {
            dismiss();
            if(onOpenMemberConfirmListener != null) onOpenMemberConfirmListener.onOpenMemberConfirm();
        });
    }

    private OnOpenMemberConfirmListener onOpenMemberConfirmListener;

    public DialogPleaseOpenMember setOnOpenMemberConfirmListener(OnOpenMemberConfirmListener onOpenMemberConfirmListener) {
        this.onOpenMemberConfirmListener = onOpenMemberConfirmListener;
        return this;
    }

    public interface OnOpenMemberConfirmListener {

        void onOpenMemberConfirm();
    }
}
